import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:get/get.dart';
import 'package:liuxlcommon/util/toast_util.dart';
import 'package:love_newf/app/com/http/Res.dart';
import 'package:love_newf/app/com/http/http_request.dart';

class ComplaintLogic extends GetxController {
  String firstMsg = "";

  submit() async {
    Res r = await HttpRequest().postRes(
        "/api/accusation/accusation", {
          "userCode":"200026",
          "content": firstMsg},
        loadingText: '提交中...');
    if (r.isSuccess()) {
      Get.back();
      ToastUtils.toast("提交成功！");
    } else {
      EasyLoading.showError(r.msg);
    }
  }
}
